package com.yidu.boss.sys.domain;

import java.io.Serializable;

/**
 * @author luoyushan
 */
public class Resource implements Serializable {
    /**
     * 资源Id
     */
    private String resourceId;

    /**
     * 资源名
     */
    private String resourceName;

    /**
     * 父资源Id
     */
    private String parentId;

    /**
     * 父资源名
     */
    private String parentName;

    /**
     * 资源路径
     */
    private String url;

    /**
     * 资源类型
     */
    private String resourceType;

    /**
     * 资源级别
     */
    private String resourceRank;

    /**
     * 资源序号
     */
    private Integer resourceIndex;

    /**
     * 是否可用
     */
    private Integer useable;

    /**
     * 描述
     */
    private String decs;

    private String role;

    private static final long serialVersionUID = 1L;

    public String getResourceId() {
        return resourceId;
    }

    public void setResourceId(String resourceId) {
        this.resourceId = resourceId;
    }

    public String getResourceName() {
        return resourceName;
    }

    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getResourceType() {
        return resourceType;
    }

    public void setResourceType(String resourceType) {
        this.resourceType = resourceType;
    }

    public String getResourceRank() {
        return resourceRank;
    }

    public void setResourceRank(String resourceRank) {
        this.resourceRank = resourceRank;
    }

    public Integer getResourceIndex() {
        return resourceIndex;
    }

    public void setResourceIndex(Integer resourceIndex) {
        this.resourceIndex = resourceIndex;
    }

    public Integer getUseable() {
        return useable;
    }

    public void setUseable(Integer useable) {
        this.useable = useable;
    }

    public String getDecs() {
        return decs;
    }

    public void setDecs(String decs) {
        this.decs = decs;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Resource other = (Resource) that;
        return (this.getResourceId() == null ? other.getResourceId() == null : this.getResourceId().equals(other.getResourceId()))
            && (this.getResourceName() == null ? other.getResourceName() == null : this.getResourceName().equals(other.getResourceName()))
            && (this.getParentId() == null ? other.getParentId() == null : this.getParentId().equals(other.getParentId()))
            && (this.getParentName() == null ? other.getParentName() == null : this.getParentName().equals(other.getParentName()))
            && (this.getUrl() == null ? other.getUrl() == null : this.getUrl().equals(other.getUrl()))
            && (this.getResourceType() == null ? other.getResourceType() == null : this.getResourceType().equals(other.getResourceType()))
            && (this.getResourceRank() == null ? other.getResourceRank() == null : this.getResourceRank().equals(other.getResourceRank()))
            && (this.getResourceIndex() == null ? other.getResourceIndex() == null : this.getResourceIndex().equals(other.getResourceIndex()))
            && (this.getUseable() == null ? other.getUseable() == null : this.getUseable().equals(other.getUseable()))
            && (this.getDecs() == null ? other.getDecs() == null : this.getDecs().equals(other.getDecs()))
            && (this.getRole() == null ? other.getRole() == null : this.getRole().equals(other.getRole()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getResourceId() == null) ? 0 : getResourceId().hashCode());
        result = prime * result + ((getResourceName() == null) ? 0 : getResourceName().hashCode());
        result = prime * result + ((getParentId() == null) ? 0 : getParentId().hashCode());
        result = prime * result + ((getParentName() == null) ? 0 : getParentName().hashCode());
        result = prime * result + ((getUrl() == null) ? 0 : getUrl().hashCode());
        result = prime * result + ((getResourceType() == null) ? 0 : getResourceType().hashCode());
        result = prime * result + ((getResourceRank() == null) ? 0 : getResourceRank().hashCode());
        result = prime * result + ((getResourceIndex() == null) ? 0 : getResourceIndex().hashCode());
        result = prime * result + ((getUseable() == null) ? 0 : getUseable().hashCode());
        result = prime * result + ((getDecs() == null) ? 0 : getDecs().hashCode());
        result = prime * result + ((getRole() == null) ? 0 : getRole().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", resourceId=").append(resourceId);
        sb.append(", resourceName=").append(resourceName);
        sb.append(", parentId=").append(parentId);
        sb.append(", parentName=").append(parentName);
        sb.append(", url=").append(url);
        sb.append(", resourceType=").append(resourceType);
        sb.append(", resourceRank=").append(resourceRank);
        sb.append(", resourceIndex=").append(resourceIndex);
        sb.append(", useable=").append(useable);
        sb.append(", decs=").append(decs);
        sb.append(", role=").append(role);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}